package com.tanhua.server.controller;

import com.tanhua.server.service.VideoService;
import com.tanhua.server.service.VoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("peachblossom")
public class VoiceController {

    @Autowired
    private VoiceService voiceService;
    /**
     * 接口名称：语音上传
     * 接口路径：POST/peachblossom
     */
    @PostMapping
    public ResponseEntity<Object> saveVoice(MultipartFile soundFile) throws IOException {
        return voiceService.saveVoice(soundFile);
    }

    /**
     * 接收语音
     * @return
     */

    @GetMapping
    public ResponseEntity<Object> findByState(){
        return voiceService.findByState();
    }

    /**
     * 喜欢语音
     */
    //public ResponseEntity<Object>


}
